/**
 * Created by zhaott on 2018/9/21.
 */
var gulp = require("gulp");
var ts = require("gulp-typescript");
var tsProject = ts.createProject("tsconfig.json");

gulp.task('default',['test']);//,'copy-html'
gulp.task('compile', function () {
    return gulp.src('src/**.ts')
        .pipe(tsProject())
        .pipe(gulp.dest('dist'));
});
gulp.task("copy-html", function () {
    return gulp.src(['src/**.json','src/**.html'])
        .pipe(gulp.dest("dist"));
});
const shell = require('gulp-shell');
gulp.task('test',['compile',"copy-html"], function () {
    return gulp.src(['dist/server.js'], {read: false})
        .pipe(shell([
            'node <%= file.path %>'
        ]))
});
